package com.hkts.reportform.utils;

/**
 * @ClassNameCrcUtils
 * @Description
 * @Author yck
 * @Date2021-09-18 10:41
 * @Version V1.0
 **/
public class CrcTest {
    public static int crcCheckOut(String str){
        System.out.println(str.length());
        byte[] bytes = str.getBytes();
        int crcReg=0x3D65;
        int check;
        for(int i=0;i<bytes.length;i++){
            crcReg=(crcReg>>8)^bytes[i];
            for(int j=0;j<8;j++){
               check=crcReg&0xFFFF;
                crcReg>>=1;
                if(check==0xFFFF){
                    crcReg^=0x0000;
                }
            }
        }
    return crcReg;
    }
    public static void main(String[] args) {
    int a=3,b=4,x=5;
    if(a*a+b*b==x*x){
        x=x<<(b-a);
    }

        System.out.println(x);
    }
}
